package com.ruoyi.share.service.impl;

import java.util.List;

import com.ruoyi.share.domain.ShareGoodsRatio;
import com.ruoyi.share.mapper.ShareGoodsRatioMapper;
import com.ruoyi.share.service.IShareGoodsRatioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 分账比例Service业务层处理
 *
 * @author ruoyi
 * @date 2021-11-16
 */
@Service
public class ShareGoodsRatioServiceImpl implements IShareGoodsRatioService
{
    @Autowired
    private ShareGoodsRatioMapper shareGoodsRatioMapper;

    /**
     * 查询分账比例
     *
     * @param id 分账比例主键
     * @return 分账比例
     */
    @Override
    public ShareGoodsRatio selectShareGoodsRatioById(Long id)
    {
        return shareGoodsRatioMapper.selectShareGoodsRatioById(id);
    }

    /**
     * 查询分账比例列表
     *
     * @param shareGoodsRatio 分账比例
     * @return 分账比例
     */
    @Override
    public List<ShareGoodsRatio> selectShareGoodsRatioList(ShareGoodsRatio shareGoodsRatio)
    {
        return shareGoodsRatioMapper.selectShareGoodsRatioList(shareGoodsRatio);
    }

    /**
     * 新增分账比例
     *
     * @param shareGoodsRatio 分账比例
     * @return 结果
     */
    @Override
    public int insertShareGoodsRatio(ShareGoodsRatio shareGoodsRatio)
    {
        return shareGoodsRatioMapper.insertShareGoodsRatio(shareGoodsRatio);
    }

    /**
     * 修改分账比例
     *
     * @param shareGoodsRatio 分账比例
     * @return 结果
     */
    @Override
    public int updateShareGoodsRatio(ShareGoodsRatio shareGoodsRatio)
    {
        return shareGoodsRatioMapper.updateShareGoodsRatio(shareGoodsRatio);
    }

    /**
     * 批量删除分账比例
     *
     * @param ids 需要删除的分账比例主键
     * @return 结果
     */
    @Override
    public int deleteShareGoodsRatioByIds(Long[] ids)
    {
        return shareGoodsRatioMapper.deleteShareGoodsRatioByIds(ids);
    }

    /**
     * 删除分账比例信息
     *
     * @param id 分账比例主键
     * @return 结果
     */
    @Override
    public int deleteShareGoodsRatioById(Long id)
    {
        return shareGoodsRatioMapper.deleteShareGoodsRatioById(id);
    }
}
